/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ufs.dcomp.mgemeos.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.sql.Time;
import java.util.Date;

/**
 *
 * @author Ricardo
 */
public class Utils {
    
    public Time formataHora(String data) throws Exception {
        if (data == null || data.equals("")) {
            return null;
        }

        Time date = null;
        try {
            DateFormat formatter = new SimpleDateFormat("HH:mm");
            date = new Time(((Date) formatter.parse(data)).getTime());
        } catch (ParseException e) {
            throw e;
        }
        return date;
    }
    
}
